all:mycat openfile

#myopen
mycat : mycat.o myopen.o read_fd.o
	gcc mycat.o myopen.o read_fd.o -o mycat
mycat.o : mycat.c 
	gcc -c mycat.c
myopen.o : myopen.c
	gcc -c myopen.c
read_fd.o : read_fd.c
	gcc -c read_fd.c

# for openfile
openfile : openfile.o write_fd.o
	gcc openfile.o write_fd.o -o openfile
openfile.o : openfile.c  
	gcc -c openfile.c
write_fd.o : write_fd.c
	gcc -c write_fd.c

clean:
	rm *.o
